package com.hula.onion.book.server.jPush;

import cn.jiguang.common.ClientConfig;
import cn.jpush.api.JPushClient;

/**
 * Created by shan on 18/2/06.
 */
public class PushFactory {
    private static JPushClient push = null;
    private static JPushClient pushPlatform = null;
    private PushFactory() {
    }

    public synchronized static JPushClient getJPushClient(String masterSecret, String appKey) {
        if (push == null) {
            ClientConfig clientConfig = ClientConfig.getInstance();
            push = new JPushClient(masterSecret, appKey, null, clientConfig);
        }
        return push;
    }

    public synchronized static JPushClient getJPushPlatformClient(String masterSecret, String appKey) {
        if (pushPlatform == null) {
            ClientConfig clientConfig = ClientConfig.getInstance();
            pushPlatform = new JPushClient(masterSecret, appKey, null, clientConfig);
        }
        return pushPlatform;
    }

}
